<div class="similar">
<h4>Похожие объявления</h4>
<?php $Params = array( 'zc'=>1,/* зоом с вырезанием */); ?>
<?php foreach ($other as $model) { ?>
<?php $h1 = $model->getH1();?> 
<div class="ad_p">
	<div class="inf_p">
		<div class="image">
			<?php $photos = $model->homePhotoses; 
			if (count($photos)) {
				$firstPhoto = $photos[0];
				$src = Home::getFolder($firstPhoto->path, false).$firstPhoto->path;
				//if (file_exists($src))
				$srcSmall = ImageResizer::resizeImage($src, array('w'=>269, 'h'=>189), 0, $Params, 'catalog');
			?>
			<a class="full-link" href="<?php echo $this->createUrl('home/view',array('city'=>'nsk', 'id'=>$model->id));?>"><?php echo CHtml::image($srcSmall ? $srcSmall : $src);?></a>
			<?php $count = count($photos);?>
			<?php if ($count - 1 > 0) { ?><span><?php echo $count?> фото</span><?php } ?>
			<?php } ?>	
		</div>
		<div class="inf_text">
		<table>
			<tr class="tp">
				<td colspan="3"><a class="full-link" href="<?php echo $this->createUrl('home/view',array('city'=>'nsk', 'id'=>$model->id));?>"><h2><?php echo $h1; ?></h2></a></td>
				<td class="price" colspan="1"><label><b><?php echo number_format($model->cost, 0, '.', ' ');?></b> руб/мес</label></td>
			</tr>
			<tr>
				<?php if ($model->area > 0) { ?>
				<td><div><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/ico/1.png"/></div><?php echo $model->area ?> м<sup>2</sup></td>
				<?php } ?>
				<td><div><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/ico/2.png"/></div><?php echo $model->furniture > 0 ? 'Есть' : 'Нет'?></td>
				<td><div><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/ico/3.png"/></div><?php echo $model->wash_machine > 0 ? 'Есть' : 'Нет'?></td>
				<td class="last"><div><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/ico/4.png"/></div><?php echo $model->address?></td>
			</tr>
			<tr>
				<?php if ($model->floor > 0) { ?>
				<td><div><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/ico/5.png" title="Этаж"></div><?php echo $model->floor.($model->max_floor>0 ? '/'.$model->max_floor : '')?> этаж</td>
				<?php } ?>
				<td><div><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/ico/6.png"/></div><?php echo $model->cooker > 0 ? 'Есть' : 'Нет'?></td>
				<td><div><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/ico/7.png"/></div><?php echo $model->fridge > 0 ? 'Есть' : 'Нет'?></td>
				<td class="last">
					<div><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/ico/8.png"/></div>
					<?php if (!$showPhone) { ?>
						<label class="phon_e"><a href="<?php $this->createUrl('pay')?>">Показать номер</a><span></span></label>
					<?php } else { ?>
						<?php $spanId = 'phone_'.$model->id ?>
						<label class="phon_e" id="<?php echo $spanId?>"><?php echo CHtml::link('Показать номер', '#', array(
						    'ajax' => array(
							    'type'=>'POST', 
							    'url'=>$this->createUrl('home/phone', array('id'=> $model->id)),
							    'update'=>'#'.$spanId, 
							    'data'=>array('id'=>$model->id,'YII_CSRF_TOKEN' => Yii::app()->request->csrfToken),
						 	 ),
						));?>
						</label>
					<?php } ?>
				</td>
			</tr>
		</table>
		</div>
		<div class="clr"></div>
	</div>
</div>
<?php } ?>
</div>